// eee.Sheffield.PZ.Imaging
//
// Copyright ?Ping Zou, 2007
// sg71.cherub@gmail.com

using System;
using System.Collections.Generic;
using System.Text;
using eee.Sheffield.PZ.Math;
using System.Drawing;
using System.Drawing.Imaging;

namespace eee.Sheffield.PZ.Imaging.ImageFilter
{
    /// <summary>
    /// base 2D double kernel class
    /// </summary>
    public abstract class DoubleKernel2D : ImageFilter
    {
        #region Fields
        protected double[,] _kernel;
        #endregion

        #region Constructor
        #endregion

        #region Apply filter
        protected override PZMath_matrix ApplyDoubleGraylevelImageFilter(PZMath_matrix srcMatrix, out string logText)
        {            
            PZMath_matrix dstMatrix = srcMatrix.Convolute2D(new PZMath_matrix(_kernel));

            logText = "succeeds.";
            return dstMatrix;
        }

        protected override PZMath_matrix[] ApplyDoubleColourImageFilter(PZMath_matrix[] srcMatrixArray, out string logText)
        {            
            PZMath_matrix[] dstMatrixArray = new PZMath_matrix[3];
            for (int i = 0; i < 3; i++)
                dstMatrixArray[i] = srcMatrixArray[i].Convolute2D(new PZMath_matrix(_kernel));

            logText = "succeeds.";
            return dstMatrixArray;
        }
        #endregion
    }
}
